
#ifndef _MEMBER_BDOCKLAYOUT_H_
#define _MEMBER_BDOCKLAYOUT_H_

#include <BSpring>
#include <BSpacer>
#include <BWidget>
#include <BDockLayout>
#include "ILayoutItem.h"

#define docklayout_member(layout)		((member_BDockLayout*)((BDockLayout*)layout)->_ptr)

namespace BWE
{
	class BWidget;

	class member_BDockLayout : public BObject
	{
	public:
		member_BDockLayout(BDockLayout* layout);
		~member_BDockLayout();

		void freshHandleIndex(const BPoint& pos);
		BRect handleRect(ILayoutItem& item, Part part);
		bool dragHandle(const BPoint& pos);

		void distributeSize();
		void applyRects();

	public:
		BLayout*			boss;
		BSizeStretch		sizeStretch;
		int					spacing;
		BSize				handleSize;
		bool				splitable;

		bool				pressed;
		BPoint				pressedPos;
		BRect				pressedRect;
		int					handleIndex;
		PartFlag			resizePart;
		BArray<ILayoutItem>	items;
	};
}

#endif
